const os = require('os');
import getMAC, { isMAC } from 'getmac'
import { ipcMain } from 'electron'

export function hostMachine(window) {
    ipcMain.on('getHostMachine', (e, arg) => {
        let macAddress = getMAC();
        let hostname = os.hostname();
        sendHostMachineMessage({
            cmd: 'os-info',
            message: {
                hostname: hostname,
                macAddress: macAddress
            }
        })
    })
    function sendHostMachineMessage(message) {
        window.webContents.send('hostMachine-message', message)
    }
}